<template>
	<!-- 收藏 -->
	<up-list @scrolltolower="getCollection">
		<up-list-item v-for="(item, index) in data" :key="index">
			<up-cell @click="details(item.id)" :title="item.title">
				<template #icon>
					<up-avatar v-if="item.img!=null" shape="square" size="35" :src="config.baseUrl+item.img"
						customStyle="margin: -3px 5px -3px 0"></up-avatar>
				</template>
			</up-cell>
		</up-list-item>
	</up-list>
</template>
<script setup>
	import config from "@/config";
	import {
		collectionList
	} from "@/api/system/record";
	import {
		ref
	} from 'vue';
	//分页信息
	const pageInfo = ref({
		pageNum: 1,
		pageSize: 10
	})
	const total = ref(0);
	const data = ref([])

	function getCollection() {
		collectionList().then(response => {
			total.value = response.total;
			data.value = response.data
			if (data.value.length < total.value) {
				data.value.push(...response.rows);
			}

		});
	}

	function details(id) {
		console.log(id);
		uni.navigateTo({
			url: '/pages/activity/details?id=' + id
		});
	}
	getCollection()
</script>

<style scoped>

</style>